<?php 
use Wdl\helper\webHelper;
?>
 
<div class="panel panel-default">
    <ul class="nav nav-tabs" style="margin-top: 5px; padding-left: 10px;">
  
        <li class="{if (empty($rd) || $rd=='index')}active{/if}">
        <a href="{php echo $this->createWebUrl('slogs', array('op' => $operation,'rd'=>'index'))}"> 
			 {$submenus[$operation]['name']}列表</a></li>

       <li class="{if (empty($rd) || $rd=='post')}active{/if}">
                <a href="{php echo $this->createWebUrl('slogs', array('op' => $operation,'rd'=>'post'))}"> 
                   添加问答</a></li>     
       
    </ul>
{if $rd == 'post'}
<div class="panel-body"> 

    <form action="{php echo $this->createWebUrl('slogs', array('op'=>'replay','rd'=>'post'))}"  method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">

        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                   <span style='color:red'></span>问答类型 </label>
           <div class="col-sm-4 col-xs-6">
                   <div class="input-group form-control">
                  <?php 
         echo   form_element::select( $htype,'data[uid]','uid',$item['uid']);
                   ?>        
                </div>
            </div>   
            <div class="col-sm-4 col-xs-6"  >
                <p>问答用于在线咨询时给客户“快捷提问” 。</p>
                <p>通用：在所有类型的房源“在线咨询”的快速提问列表中都有，“二手房，租房”等类型只在对应房源 咨询时出现。</p>
            </div>     
       </div>

        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    <span style='color:red'>*</span>问题标题 </label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="data[titlepic]" id="titlepic" class="form-control"
                                placeholder="必填项 "  value="{$item['titlepic']}" />
                        
            </div>
        </div>
   
        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    <span style='color:red'>*</span>回复内容 </label>
            <div class="col-sm-9 col-xs-12">
                <textarea type="text" name="data[smalltext]" style="height: 300px;"
                   id="smalltext" class="form-control">{$item['smalltext']}</textarea>
                        
            </div>
        </div>
         
        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    <span style='color:red'>*</span>状态 </label>
            <div class="col-sm-9 col-xs-12">
                <input type="radio" name="data[disabled]"  class=" "
                             {if $item['disabled']==0}checked{/if}  value="0" />启用
                        
                        <input type="radio" name="data[disabled]"  class=" "
                             {if $item['disabled']==1}checked{/if}   value="1" />禁用
                        
            </div>
        </div>
        <div class="form-group ">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">操作</label>
            <div class="col-sm-9 col-xs-12">
                        <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
                        <input type="hidden" name="id" value="{$item['id']}" />
                        <input type="hidden" name="token" value="{$_W['token']}" />
        
                </div>
        </div>
         </form>

</div>

{else}
    <div class="panel-body table-responsive">
       	 
        <form action="./index.php" method="get" class="form-horizontal" role="form">
            <div class="search-box" style="margin-bottom: 20px; width: 100%; align-items: center; ">          
		
                <div  style="margin-right: 10px;">
                    <span >关键字 :</span>
                </div>
          
				<div class="col-xs-12 col-sm-6 col-lg-6">
                    <input type="hidden" name="c" value="site" />
                    <input type="hidden" name="a" value="entry" />
                    <input type="hidden" name="m" value="kbwdl_shequzufang" />
                    <input type="hidden" name="do" value="slogs" />
                    <input type="hidden" name="op" value="{$operation}" />
                   
					<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">

				</div>
                 <div class="col-xs-12 col-sm-2 col-lg-2">

					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>

				</div>
             
        </div>
		</form>
      
        <!-- 搜索结束 -->
        <table class="table table-hover">
			<thead class="navbar-inner">
	            <tr>
                    <th style="width:5%;">ID</th>
                    <th >标题</th>	
					<th>回复内容</th>                  
					<th  style="width:15%;">类型 </th>
					<th style="text-align:right">操作</th>
				</tr>
             
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td>{$item['id']}</td>
					
					<td>
                        <p> 
                          {$item['titlepic']}
                           
                        </p>
                    </td>
                    <td> 
                        <p>                                           
					   
                      {$item['smalltext']}
                        </p>
                        
					</td>
					<td>
                        <p> {$htype[$item['uid']]}</p>
					</td>

					<td style="text-align:right;">                     
                        <a href="{php echo $this->createWebUrl('slogs', array('id' => $item['id'], 'op' => 'replay','rd'=>'post'))}" class="btn btn-default btn-sm"  title="编辑"><i class="fa fa-pencil"></i></a>&nbsp;&nbsp;

						<a href="{php echo $this->createWebUrl('slogs', array('id' => $item['id'], 'op' => 'replay'))}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" class="btn btn-default btn-sm"  title="删除"><i class="fa fa-times"></i></a>
                        </p>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
		{$pager}
    </div>


{/if}
</div>